﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace InsideDL.MISService
{
    public class VerifyATM973:VerifyMatrix
    {
        public override bool CheckFileInFtp(object[] p_paras)
        {
            string ftp, id, pw, currentYM,ARTM;
            
            ftp = Convert.ToString(p_paras[0]);
            id = Convert.ToString(p_paras[1]);
            pw = Convert.ToString(p_paras[2]);
            currentYM = Convert.ToString(p_paras[3]);
            ARTM = string.Format("ARTM973_{0}",currentYM);
            string[] fileList = Utility.GetFTPFileList(ftp, id, pw);
            downList = (from aa in (from fl in fileList
                        where fl.IndexOf(".TXT") > 0
                            & fl.Substring(0, 3).Equals("ART")
                        select fl) where aa.Substring(0,14).Equals(ARTM)
                        select aa).ToArray();
            return downList.Length == 1 ? true : false;            
        }
    }
}
